package com.hskn.hss.utils;

import java.math.BigInteger;
import java.security.MessageDigest;

public class SHA {

    public static final String KEY_SHA = "SHA";

    public static String getResult(String str) {
        BigInteger sha = null;
        byte[] inputData = str.getBytes();
        try {
            MessageDigest messageDigest = MessageDigest.getInstance(KEY_SHA);
            messageDigest.update(inputData);
            sha = new BigInteger(messageDigest.digest());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return sha.toString(32).toUpperCase();
    }

    public static void main(String[] args) {
//        log.info(getResult("123456asdfghj#$%^&*()Okhgfdwswertyjhds"));
    }
}
